package com.itheima05;

import java.util.concurrent.atomic.AtomicInteger;

public class MyAtomIntergerDemo {
    public static void main(String[] args) {
        AtomicInteger ac1=new AtomicInteger(10);
        System.out.println(ac1.get());

        AtomicInteger ac2=new AtomicInteger(10);
        int andIncrement = ac2.getAndIncrement();
        System.out.println(andIncrement);
        System.out.println(ac2.get());

        AtomicInteger ac3=new AtomicInteger(10);
        int i = ac3.incrementAndGet();
        System.out.println(i);
        System.out.println(ac3.get());

        AtomicInteger ac4=new AtomicInteger(10);
        int i1 = ac4.addAndGet(20);
        System.out.println(i1);
        System.out.println(ac4.get());

    }
}
